﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using L = Science.Mathematics.LinearAlgebra;

namespace Strang3Ed.Chapter02.Section7
{
    public class ExampleA
    {
        public ExampleA()
        {
        }
        private string result;
        public string Result
        {
            get { return result; }
        }
        public void Compute()
        {
            double[,] x = {{0.0,1.0,0.0},                           
                           {0.0,0.0,1.0},
                           {1.0,0.0,0.0}};

            L.Matrix P = new L.Matrix(x);

            double[,] y = {{1.0,4.0,5.0},                           
                           {4.0,2.0,6.0},
                           {5.0,6.0,3.0}};

            L.Matrix A = new L.Matrix(y);

            L.Matrix PAPt = P * A * P.Transpose;

            result += PAPt.ToString();
        }
    }
}
/*
2     6     4     
6     3     5     
4     5     1     
*/